package com.m4f.city.utils.tag.datatable;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

public class ActionColumnTag extends TagSupport {
	private String i18nName; // The action name
	private String name;
	private String url; // The link to execute the action
	
	public ActionColumnTag() {
		this.i18nName = "";
		this.name = "";
		this.url = "";
	}
	
	public ActionColumnTag(ActionColumnTag action) {
		this.i18nName = action.getI18nName();
		this.name = action.getName();
		this.url = action.getUrl();
	}
	
	@Override
	public int doStartTag() throws JspException {
		ActionColumnTag newAction = new ActionColumnTag(this);
		((DataTableActionColumnTag)getParent()).addAction(newAction);
		return super.doStartTag();
	}
	
	// GETTERS AND SETTERS
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getI18nName() {
		return i18nName;
	}
	public void setI18nName(String i18nName) {
		this.i18nName = i18nName;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
}
